#ifndef __HOMESERVER_H
#define __HOMESERVER_H
#include "Threadpool.h"
#include "TcpServer.h"

class HomeServer
{
public:
    HomeServer(unsigned short port, const string &ip, int threadNum, int taskSize);
    void start();
    void stop();

private:
    void onConnection(TcpConnectionPtr conn);
    void onMessage(TcpConnectionPtr conn);
    void onClose(TcpConnectionPtr conn);

private:
    Threadpool _threadpool;
    TcpServer _server;
};

#endif
